import tkinter as tk
import tkinter.messagebox as mb

win = tk.Tk()
win.title('My First GUI')
win.geometry('300x300')

l1 = tk.Label(win,text = 'hello world', bg ='green')
l1.pack()
def hit_me():
    #mb.showinfo(title='Hi',message='hello')
    lb1.insert('end','天津')
b1 = tk.Button(win, text='hit me', font=('Arial', 12), width=10, height=1,command = hit_me)
b1.pack()


e1 = tk.Entry(win, text='edit me', font=('Arial', 12))
e1.pack()
lb1 = tk.Listbox(win)
lb1.pack() 
lb1.insert("end", '北京')
lb1.insert("end", '上海')
lb1.insert("end", '重庆')


b1.command = hit_me
win.mainloop()

